<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>字典管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
	    	return false;
	    }
		
		function exportData(){
			var id=$('#actId').val();
			if(id!=''){
				$("#searchForm").attr("action","${ctx}/bf/excelExport");
		        $("#searchForm").submit();
		        $("#searchForm").attr("action","${ctx}/bf/getList");
			}else{
				alert('请选择活动');
				return;
			}
			
		}
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/bf/getList/">活动统计列表</a></li>
	</ul>
	<form:form id="searchForm" modelAttribute="actUser" action="${ctx}/bf/getList/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<div>
			<label>活动名称：</label>
			<form:select id="actId" path="actId" class="input-medium">
					<option value="">&nbsp;&nbsp;&nbsp;&nbsp;-----请选择-----&nbsp;&nbsp;&nbsp;&nbsp;</option>
					<c:forEach items="${actList }" var="act">
					<option value="${act.id }" <c:if test="${act.id==actId }">selected</c:if>>${act.actName }</option>
					</c:forEach>
				</form:select>
			&nbsp;&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>&nbsp;&nbsp;
			<input id="btnExport" class="btn btn-primary" type="button" value="导出" onclick="exportData();"/>
		</div>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead><tr><th>ID</th><th>准考证号</th><th>真实姓名</th><th>身份证号</th><th>用户名</th><th>所在地区</th><th>联系地址</th><th>邮政编码</th><th>联系电话</th><th>提交时间</th><th>得分情况</th><th>总分</th><th>状态</th><th>操作</th></tr></thead>
		<tbody>
		<c:forEach items="${page.list}" var="act">
			<tr>
				<td>${act.id}</td>
				<td>${act.examNumber}</td>
				<td>${act.realName}</td>
				<td>${act.idNumber}</td>
				<td>${act.userName}</td>
				<td>${act.cityName}</td>
				<td>${act.address}</td>
				<td>${act.postcode}</td>
				<td>${act.mobile}</td>
				<td><fmt:formatDate value='${act.createTime}' pattern="yyyy-MM-dd HH:mm"/></td>
				<td>${act.scoreStr}</td>
				<td>${act.totalScore}</td>
				<td>${act.status==1?"正常":"隐藏"}</td>
				<td>
				<c:if test="${act.status==1}">
				<a href="${ctx}/bf/updStatus/?id=${act.id}&status=2&actId=${actId}" onclick="return confirmx('确认要隐藏该数据吗？', this.href)">隐藏</a>
				</c:if>
				<c:if test="${act.status==2}">
				<a href="${ctx}/bf/updStatus/?id=${act.id}&status=1&actId=${actId}" onclick="return confirmx('确认要显示该数据吗？', this.href)">显示</a>
				</c:if>
				&nbsp;&nbsp;&nbsp;<a href="${ctx}/bf/updStatus/?id=${act.id}&status=3&actId=${actId}" onclick="return confirmx('确认要删除该数据吗？', this.href)">删除</a></td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>